#include "base_tick.h"

CBaseTickTimer::CBaseTickTimer()
{
	m_dwBeginTick = 0;
	m_dwEndTick   = 0;
}
CBaseTickTimer::~CBaseTickTimer()
{

}

void CBaseTickTimer::BeginTick()
{
	m_dwBeginTick = GetTickCount();
}
DWORD CBaseTickTimer::EndTick()
{
	m_dwEndTick = GetTickCount();
	return m_dwEndTick-m_dwBeginTick;
}
int CBaseTickTimer::DistanceTick( DWORD nTick )
{
	if( m_dwEndTick - m_dwBeginTick > nTick )
	{
		return 1;
	}
	else if( m_dwEndTick - m_dwBeginTick < nTick )
	{
		return -1;
	}
	else
	{
		return 0;
	}
}